<?php /*
	
*/ ?>
<?php include("system/config.inc.php");
$donotinclude = 1;
if(!isset($_SESSION['adminuserid']))
{
	header("location:index.php?msg=logfirst");
	die();
}
?>
<?php include("inc/header.php");?>
<body>



<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" class="middlebackground">
  <tr>
    <td valign="top" align="center"><?php include(INC."top.inc.php");?></td>
  </tr>
  <tr valign="top">
    <td align="center"><table width="75%" border="0" cellpadding="2" cellspacing="2" class="border">
      <tr class="bg1">
        <td colspan="6">Customer Order Status... </td>
        </tr>
      <tr align="center" class="tblbg3">
        <td width="23%"><strong>Customer</strong></td>
        <!--<td><strong>Order Status </strong></td>
		<td><strong>Date </strong></td>-->
		<td width="16%"><strong>Order Total </strong></td>
		<td width="14%"><strong>Date </strong></td>
		<td width="8%"><strong>Edit </strong></td>
		<td width="16%"><strong>Invoice </strong></td>
		<td width="23%"><strong>Packing Slip</strong></td>
      </tr>
	  
	  <?php
			//$customer = $_REQUEST['cust'];
			//echo $customer;
			//die();
			/**************************************
					PAGING CODE START
			**************************************/
				//$rowperpage=23;
				$tablename="tblorders";
				$per_page_keywords= "intcustomerid=".$_REQUEST['cust'];
				$per_page_sorts= "";			
				include("system/paging.inc.php");
				
			/**************************************
					PAGING CODE ENDING
			**************************************/
			
			//$order = $sql[$j]['intid'];
			
			$sql_select = "select * 
			from  ".$tablename."
			where ".$per_page_keywords."			
			Limit ".($page_no*$row_per_page).",".$row_per_page; 
			
			$sql = $obj_db->select($sql_select);
			if($sql)
			{
			
				for($j=0;$j<count($sql);$j++)
				{ 
				
					$order = $sql[$j]['intid'];
		  ?>
		  <?php /*<a href="orderinfo.php?custid=<?php=$sql[$j]['intcustomerid'];;?>"> */?>
	    <tr align="center" class="<?php echo ($i%2==0)?"Hrnormal":"Hralter"; ?>" onMouseOver="this.className='Hrhover';" onMouseOut="this.className='<?php echo ($i%2==0)?"Hrnormal":"Hralter"; ?>';">
        
        <?php		
		$sql1 = "SELECT * FROM tblcustomers WHERE `intcusid` =".$_REQUEST['cust'];
		$res=$obj_db->select($sql1);
		//echo $sql1;
		//die();
		
		if($sql1)
			{			
				for($j1=0;$j1<count($res);$j1++)
				{
				?>
				
					<td><?php echo $res[$j1]['varcustfname']."&nbsp;&nbsp;".$res[$j1]['varcustlname'];?></td>
				<?php
				}
			}?> 
        <!--<td><?php echo $res[$j1]['intstatus']; ?></td>
		<td><?php echo $sql[$j]['dtdateadded']; ?></td>-->
		<td>$<?php echo $sql[$j]['deccurrencyvalue']; ?></td>
		<td><?php echo $sql[$j]['dtdateadded']; ?></td>
		<td><a Title='Click here for More Order Info' href="orderinfo.php?oid=<?php echo $sql[$j]['intid'];?>" class="fntstyle1">Edit</a></td>
		<td><a href="#" Title='Click here for Invoice Details' onclick="window.open('invoice.php?order=<?php echo $order;?>','','');" class="fntstyle1">Invoice</a></td>
		<td><a href="#" Title='Click here for Packing Slip Details' onclick="window.open('packingslip.php?order=<?php echo $order;?>','','');" class="fntstyle1">Packing Slip</a></td>
      </tr> 
	  <?php //</a> ?>
	  <?php  } } ?>
	  
      
      <tr>
        
        <td colspan="6" align="center"><?php pagindet_atbotttom_page($div_page_no,$page_no,$req_querystr,$total_db_rec,$row_per_page); ?></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center">&nbsp;</td>
  </tr>
</table>

</body>
</html>
